package com.mybatis.mp.scenery.config;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * druid 数据源连接池配置
 * @author cc
 * @date 2019/04/17
 */
@Data
@ToString
@Component
public class DruidConfig {

    @Value("${common.druid.maxActive}")
    private Integer maxActive;

    @Value("${common.druid.initialSize}")
    private Integer initialSize;

    @Value("${common.druid.maxWait}")
    private Integer maxWait;

    @Value("${common.druid.minIdle}")
    private Integer minIdle;

    @Value("${common.druid.timeBetweenEvictionRunsMillis}")
    private Long timeBetweenEvictionRunsMillis;

    @Value("${common.druid.minEvictableIdleTimeMillis}")
    private Long minEvictableIdleTimeMillis;

    @Value("${common.druid.validationQuery}")
    private String validationQuery;

    @Value("${common.druid.testWhileIdle}")
    private Boolean testWhileIdle;

    @Value("${common.druid.testOnBorrow}")
    private Boolean testOnBorrow;

    @Value("${common.druid.testOnReturn}")
    private Boolean testOnReturn;

    @Value("${common.druid.maxOpenPreparedStatements}")
    private Integer maxOpenPreparedStatements;

    @Value("${common.druid.removeAbandoned}")
    private Boolean removeAbandoned;

    @Value("${common.druid.removeAbandonedTimeout}")
    private Integer removeAbandonedTimeout;

}
